<div class="col-md-12">

<!-- BEGIN BORDERED TABLE PORTLET-->
<?php echo $this->Form->create($als); ?>
<?php echo $this->Form->hidden('action', array('value' => 'update'));  ?>
<div class="portlet">
	<div class="portlet-title">
		<div class="caption"> <i class="fa fa-cogs"></i><?= __('Tin nhắn'); ?> </div>
		<div class="tools"> </div>
	</div>
	<div class="portlet-body">
		<div class="table-toolbar">
		<div class="btn-group mt5 mb5 adm-group-action">
			<?php echo $this->Form->hidden('status', array('value' => ''));  ?>
			<div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <span><?= __('-- chọn hành động --'); ?></span>
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li>
                        <a href="#" data-type="action" data-status="9"><i class="fa fa-trash-o text-danger"></i> <?= __('Xóa mẫu tin được chọn'); ?></a>
                    </li>
                </ul>
            </div>
            <button type="submit" class="btn btn-danger" data-confirm="<?= __('Bạn có chắc chắn muốn đổi trạng thái những mẫu tin được chọn không?'); ?>" tabindex="-1"><?= __('Thực hiện'); ?></button>
		</div>
	</div>

		<div class="table-responsive clearfix">
			<table class="table table-bordered table-hover mb5">
			<thead>
			<tr>
				<th style="width:18px"><input type="checkbox" class="select-all" /></th>
				<th><?= __('Tên');?></th>
				<th><?= __('E-mail');?></th>
				<th><?= __('Tiêu đề');?></th>
				<th><?= __('Trạng thái');?></th>
				<th></th>
			</tr>
			</thead>
			<tbody>
			<?php if(count($items) > 0):?>
			<?php foreach($items as $k => $v):?>
				<!-- Kiem tra quyen -->
	            <?php
	                $_class = '';
	                if($v[$als]['status'] == 0) {
	                    $_class = 'success';
	                }
	            ?>

	            <tr class="<?= $_class; ?>">
					<td> <?php  echo $this->Form->checkbox('del.' . $v[$als]['id']); ?> </td>
					<td><?= $v[$als]['fullname'] ;?></td>
					<td><?= $v[$als]['email'] ;?></td>
					<td><?= $v[$als]['title'] ;?></td>
					<td>
						<?php if($v[$als]['status'] == 1): ?>
							<span class="label label-success arrowed-in-right arrowed-in">Đã xem</span>
						<?php else: ?>
							<span class="label label-info arrowed-in-right arrowed-in">Chưa xem</span>
						<?php endif; ?>
					</td>
					<td align="center">
						<a href="<?= $this->webroot.'admin/messages/detail/' . $v[$als]['id'] ?>" class="tooltips tooltip-primary" data-placement="top" data-original-title="Xem chi tiết"><i class="fa fa-search-plus text-primary"></i></a>
					</td>
				</tr>
			<?php endforeach; endif;?>
			</tbody>
			</table>

			<?php $params = $this->Paginator->params(); if($params['pageCount'] > 1) :?>
				<div class="clearfix"></div>
				<?php echo $this->element('paging'); ?>
			<?php endif; ?>
		</div>
	</div>
</div>
<?php echo $this->Form->end(); ?>
<!-- END BORDERED TABLE PORTLET-->
</div>
